#include<iostream>
#include<conio.h>
#include<stdio.h>

using namespace std;

class CRectangle
{
	int w;
	int h;
public:
	void setValues(int a,int b);
	int area();
};
void CRectangle::setValues(int a,int b)
{
	w = a;
	h = b;
}
int CRectangle::area()
{
	return( w * h );
}
int main()
{
	CRectangle recta;
	recta.setValues(3,4);
	CRectangle *rectb;
	rectb = &recta;
	rectb->setValues(3,9);
	cout<<"area a: "<<recta.area();
	cout<<"\n";
	cout<<"area b: "<<rectb->area();
	CRectangle *rectc = new CRectangle();
	rectc->setValues(5,6);
	rectb = rectc;
	rectc->setValues(7,8);
	cout<<"\n";
	cout<<"area b: "<<rectb->area();
	cout<<"\n";
	cout<<"area c: "<<rectc->area();
	delete rectc;
	getch();
	return 0;
}
